$(function() {
    var data = [
      ['Java', '1', '降', '-0.01%'],
      ['C', '2', '升', '+2.44%'],
      ['Python', '3', '升', '+1.41%'],
      ['C++', '4', '降', '-2.58%'],
      ['C#', '5', '升', '+2.07%'],
      ['Visual Basic.NET', '6', '降', '-1.17%'],
      ['JavaScript', '7', '降', '-0.85%'],
    ];
    var xData = [2000,2005,2010,2015,2020],
        yData = [2,4,6,8,10];
  
    var container = $('.main');
    var myChart = echarts.init($('.main1').get(0));

    var option = {
        title: {
          text: 'JavaScript语言排名变化'
        },
        mark:'true',
        tooltip: {
            trigger: 'axis',
            formatter: '{a} <br/>{b} : {c}'
        },
        // legend: {
        //   data:['排名']
        // },
        xAxis: {
          data: xData
        },
        yAxis: {},
        series: [{
          name: '排名',
          type: 'line',
        //   smooth: 'false',
          data: [6,9,8,8,7]
        }]
      };
    
      myChart.setOption(option);


    /* global Handsontable: true */
    var hot = new Handsontable(container.get(0), {
      data: data,
      contextMenu: true,          // 启用快捷菜单
      manualRowResize : true,     // 允许行拖动  
      manualColumnResize : true,  // 允许列拖动 
      colWidths: 150,//定义列宽度
      rowHeights:20 ,//定义行高度
      className: "htCenter htMiddle",//居中
    //   rowHeaders: true,
      //colHeaders: true
      colHeaders: [
        '语言名称',
        '排名',
        '升或降',
        '变化幅度',
      ]
    });
    return hot;
  });
